package sg.techstudio.suntec.object;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import sg.techstudio.suntec.serialize.CustomJsonDateDeserializer;
import sg.techstudio.suntec.serialize.CustomJsonDateSerializer;

@Entity
public class RestEventContactObj implements Serializable{
	protected static final long serialVersionUID = 6673599437328316826L;

	@JsonIgnore
	@Id
	@GeneratedValue
	private Long id;
	private long extId;
	private int type;
	private String name;
	
	private boolean active;
	@JsonDeserialize(using=CustomJsonDateDeserializer.class)
	@JsonSerialize(using=CustomJsonDateSerializer.class)
	private Date activateStartDate, activateEndDate;
	private String contactEmail;
	private String internalEmail;
	@JsonIgnore
	private Date createdDate=new Date(), updatedDate;
	@OneToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL, orphanRemoval=true)
	private List<WifiAccountObj> wifiAccoutList;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public long getExtId() {
		return extId;
	}

	public void setExtId(long extId) {
		this.extId = extId;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public Date getActivateStartDate() {
		return activateStartDate;
	}

	public void setActivateStartDate(Date activateStartDate) {
		this.activateStartDate = activateStartDate;
	}

	public Date getActivateEndDate() {
		return activateEndDate;
	}

	public void setActivateEndDate(Date activateEndDate) {
		this.activateEndDate = activateEndDate;
	}

	public String getContactEmail() {
		return contactEmail;
	}

	public void setContactEmail(String contactEmail) {
		this.contactEmail = contactEmail;
	}

	public String getInternalEmail() {
		return internalEmail;
	}

	public void setInternalEmail(String internalEmail) {
		this.internalEmail = internalEmail;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Date getUpdatedDate() {
		return updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public List<WifiAccountObj> getWifiAccoutList() {
		return wifiAccoutList;
	}

	public void setWifiAccoutList(List<WifiAccountObj> wifiAccoutList) {
		this.wifiAccoutList = wifiAccoutList;
	}
		
}
